//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

import Foundation
import SotoCore

extension MediaConnect {
    // MARK: Enums

    public enum Algorithm: String, CustomStringConvertible, Codable, _SotoSendable {
        case aes128
        case aes192
        case aes256
        public var description: String { return self.rawValue }
    }

    public enum Colorimetry: String, CustomStringConvertible, Codable, _SotoSendable {
        case bt2020 = "BT2020"
        case bt2100 = "BT2100"
        case bt601 = "BT601"
        case bt709 = "BT709"
        case st20651 = "ST2065-1"
        case st20653 = "ST2065-3"
        case xyz = "XYZ"
        public var description: String { return self.rawValue }
    }

    public enum DurationUnits: String, CustomStringConvertible, Codable, _SotoSendable {
        case months = "MONTHS"
        public var description: String { return self.rawValue }
    }

    public enum EncoderProfile: String, CustomStringConvertible, Codable, _SotoSendable {
        case high
        case main
        public var description: String { return self.rawValue }
    }

    public enum EncodingName: String, CustomStringConvertible, Codable, _SotoSendable {
        case jxsv
        case pcm
        case raw
        case smpte291
        public var description: String { return self.rawValue }
    }

    public enum EntitlementStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case disabled = "DISABLED"
        case enabled = "ENABLED"
        public var description: String { return self.rawValue }
    }

    public enum FailoverMode: String, CustomStringConvertible, Codable, _SotoSendable {
        case failover = "FAILOVER"
        case merge = "MERGE"
        public var description: String { return self.rawValue }
    }

    public enum KeyType: String, CustomStringConvertible, Codable, _SotoSendable {
        case speke
        case srtPassword = "srt-password"
        case staticKey = "static-key"
        public var description: String { return self.rawValue }
    }

    public enum MaintenanceDay: String, CustomStringConvertible, Codable, _SotoSendable {
        case friday = "Friday"
        case monday = "Monday"
        case saturday = "Saturday"
        case sunday = "Sunday"
        case thursday = "Thursday"
        case tuesday = "Tuesday"
        case wednesday = "Wednesday"
        public var description: String { return self.rawValue }
    }

    public enum MediaStreamType: String, CustomStringConvertible, Codable, _SotoSendable {
        case ancillaryData = "ancillary-data"
        case audio
        case video
        public var description: String { return self.rawValue }
    }

    public enum NetworkInterfaceType: String, CustomStringConvertible, Codable, _SotoSendable {
        case efa
        case ena
        public var description: String { return self.rawValue }
    }

    public enum PriceUnits: String, CustomStringConvertible, Codable, _SotoSendable {
        case hourly = "HOURLY"
        public var description: String { return self.rawValue }
    }

    public enum Range: String, CustomStringConvertible, Codable, _SotoSendable {
        case full = "FULL"
        case fullprotect = "FULLPROTECT"
        case narrow = "NARROW"
        public var description: String { return self.rawValue }
    }

    public enum ReservationState: String, CustomStringConvertible, Codable, _SotoSendable {
        case active = "ACTIVE"
        case canceled = "CANCELED"
        case expired = "EXPIRED"
        case processing = "PROCESSING"
        public var description: String { return self.rawValue }
    }

    public enum ResourceType: String, CustomStringConvertible, Codable, _SotoSendable {
        case mbpsOutboundBandwidth = "Mbps_Outbound_Bandwidth"
        public var description: String { return self.rawValue }
    }

    public enum ScanMode: String, CustomStringConvertible, Codable, _SotoSendable {
        case interlace
        case progressive
        case progressiveSegmentedFrame = "progressive-segmented-frame"
        public var description: String { return self.rawValue }
    }

    public enum SourceType: String, CustomStringConvertible, Codable, _SotoSendable {
        case entitled = "ENTITLED"
        case owned = "OWNED"
        public var description: String { return self.rawValue }
    }

    public enum State: String, CustomStringConvertible, Codable, _SotoSendable {
        case disabled = "DISABLED"
        case enabled = "ENABLED"
        public var description: String { return self.rawValue }
    }

    public enum Status: String, CustomStringConvertible, Codable, _SotoSendable {
        case active = "ACTIVE"
        case deleting = "DELETING"
        case error = "ERROR"
        case standby = "STANDBY"
        case starting = "STARTING"
        case stopping = "STOPPING"
        case updating = "UPDATING"
        public var description: String { return self.rawValue }
    }

    public enum Tcs: String, CustomStringConvertible, Codable, _SotoSendable {
        case bt2100linhlg = "BT2100LINHLG"
        case bt2100linpq = "BT2100LINPQ"
        case density = "DENSITY"
        case hlg = "HLG"
        case linear = "LINEAR"
        case pq = "PQ"
        case sdr = "SDR"
        case st20651 = "ST2065-1"
        case st4281 = "ST428-1"
        public var description: String { return self.rawValue }
    }

    public enum `Protocol`: String, CustomStringConvertible, Codable, _SotoSendable {
        case cdi
        case fujitsuQos = "fujitsu-qos"
        case rist
        case rtp
        case rtpFec = "rtp-fec"
        case srtCaller = "srt-caller"
        case srtListener = "srt-listener"
        case st2110Jpegxs = "st2110-jpegxs"
        case zixiPull = "zixi-pull"
        case zixiPush = "zixi-push"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AddFlowMediaStreamsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn"))
        ]

        /// The Amazon Resource Name (ARN) of the flow.
        public let flowArn: String
        /// The media streams that you want to add to the flow.
        public let mediaStreams: [AddMediaStreamRequest]

        public init(flowArn: String, mediaStreams: [AddMediaStreamRequest]) {
            self.flowArn = flowArn
            self.mediaStreams = mediaStreams
        }

        private enum CodingKeys: String, CodingKey {
            case mediaStreams
        }
    }

    public struct AddFlowMediaStreamsResponse: AWSDecodableShape {
        /// The ARN of the flow that you added media streams to.
        public let flowArn: String?
        /// The media streams that you added to the flow.
        public let mediaStreams: [MediaStream]?

        public init(flowArn: String? = nil, mediaStreams: [MediaStream]? = nil) {
            self.flowArn = flowArn
            self.mediaStreams = mediaStreams
        }

        private enum CodingKeys: String, CodingKey {
            case flowArn
            case mediaStreams
        }
    }

    public struct AddFlowOutputsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn"))
        ]

        /// The flow that you want to add outputs to.
        public let flowArn: String
        /// A list of outputs that you want to add.
        public let outputs: [AddOutputRequest]

        public init(flowArn: String, outputs: [AddOutputRequest]) {
            self.flowArn = flowArn
            self.outputs = outputs
        }

        private enum CodingKeys: String, CodingKey {
            case outputs
        }
    }

    public struct AddFlowOutputsResponse: AWSDecodableShape {
        /// The ARN of the flow that these outputs were added to.
        public let flowArn: String?
        /// The details of the newly added outputs.
        public let outputs: [Output]?

        public init(flowArn: String? = nil, outputs: [Output]? = nil) {
            self.flowArn = flowArn
            self.outputs = outputs
        }

        private enum CodingKeys: String, CodingKey {
            case flowArn
            case outputs
        }
    }

    public struct AddFlowSourcesRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn"))
        ]

        /// The flow that you want to mutate.
        public let flowArn: String
        /// A list of sources that you want to add.
        public let sources: [SetSourceRequest]

        public init(flowArn: String, sources: [SetSourceRequest]) {
            self.flowArn = flowArn
            self.sources = sources
        }

        private enum CodingKeys: String, CodingKey {
            case sources
        }
    }

    public struct AddFlowSourcesResponse: AWSDecodableShape {
        /// The ARN of the flow that these sources were added to.
        public let flowArn: String?
        /// The details of the newly added sources.
        public let sources: [Source]?

        public init(flowArn: String? = nil, sources: [Source]? = nil) {
            self.flowArn = flowArn
            self.sources = sources
        }

        private enum CodingKeys: String, CodingKey {
            case flowArn
            case sources
        }
    }

    public struct AddFlowVpcInterfacesRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn"))
        ]

        /// The flow that you want to mutate.
        public let flowArn: String
        /// A list of VPC interfaces that you want to add.
        public let vpcInterfaces: [VpcInterfaceRequest]

        public init(flowArn: String, vpcInterfaces: [VpcInterfaceRequest]) {
            self.flowArn = flowArn
            self.vpcInterfaces = vpcInterfaces
        }

        private enum CodingKeys: String, CodingKey {
            case vpcInterfaces
        }
    }

    public struct AddFlowVpcInterfacesResponse: AWSDecodableShape {
        /// The ARN of the flow that these VPC interfaces were added to.
        public let flowArn: String?
        /// The details of the newly added VPC interfaces.
        public let vpcInterfaces: [VpcInterface]?

        public init(flowArn: String? = nil, vpcInterfaces: [VpcInterface]? = nil) {
            self.flowArn = flowArn
            self.vpcInterfaces = vpcInterfaces
        }

        private enum CodingKeys: String, CodingKey {
            case flowArn
            case vpcInterfaces
        }
    }

    public struct AddMaintenance: AWSEncodableShape {
        /// A day of a week when the maintenance will happen. Use Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday.
        public let maintenanceDay: MaintenanceDay
        /// UTC time when the maintenance will happen. Use 24-hour HH:MM format. Minutes must be 00. Example: 13:00. The default value is 02:00.
        public let maintenanceStartHour: String

        public init(maintenanceDay: MaintenanceDay, maintenanceStartHour: String) {
            self.maintenanceDay = maintenanceDay
            self.maintenanceStartHour = maintenanceStartHour
        }

        private enum CodingKeys: String, CodingKey {
            case maintenanceDay
            case maintenanceStartHour
        }
    }

    public struct AddMediaStreamRequest: AWSEncodableShape {
        /// The attributes that you want to assign to the new media stream.
        public let attributes: MediaStreamAttributesRequest?
        /// The sample rate (in Hz) for the stream. If the media stream type is video or ancillary data, set this value to 90000. If the media stream type is audio, set this value to either 48000 or 96000.
        public let clockRate: Int?
        /// A description that can help you quickly identify what your media stream is used for.
        public let description: String?
        /// A unique identifier for the media stream.
        public let mediaStreamId: Int
        /// A name that helps you distinguish one media stream from another.
        public let mediaStreamName: String
        /// The type of media stream.
        public let mediaStreamType: MediaStreamType
        /// The resolution of the video.
        public let videoFormat: String?

        public init(attributes: MediaStreamAttributesRequest? = nil, clockRate: Int? = nil, description: String? = nil, mediaStreamId: Int = 0, mediaStreamName: String, mediaStreamType: MediaStreamType, videoFormat: String? = nil) {
            self.attributes = attributes
            self.clockRate = clockRate
            self.description = description
            self.mediaStreamId = mediaStreamId
            self.mediaStreamName = mediaStreamName
            self.mediaStreamType = mediaStreamType
            self.videoFormat = videoFormat
        }

        private enum CodingKeys: String, CodingKey {
            case attributes
            case clockRate
            case description
            case mediaStreamId
            case mediaStreamName
            case mediaStreamType
            case videoFormat
        }
    }

    public struct AddOutputRequest: AWSEncodableShape {
        /// The range of IP addresses that should be allowed to initiate output requests to this flow. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.
        public let cidrAllowList: [String]?
        /// A description of the output. This description appears only on the AWS Elemental MediaConnect console and will not be seen by the end user.
        public let description: String?
        /// The IP address from which video will be sent to output destinations.
        public let destination: String?
        /// The type of key used for the encryption. If no keyType is provided, the service will use the default setting (static-key).
        public let encryption: Encryption?
        /// The maximum latency in milliseconds. This parameter applies only to RIST-based, Zixi-based, and Fujitsu-based streams.
        public let maxLatency: Int?
        /// The media streams that are associated with the output, and the parameters for those associations.
        public let mediaStreamOutputConfigurations: [MediaStreamOutputConfigurationRequest]?
        /// The minimum latency in milliseconds for SRT-based streams. In streams that use the SRT protocol, this value that you set on your MediaConnect source or output represents the minimal potential latency of that connection. The latency of the stream is set to the highest number between the sender’s minimum latency and the receiver’s minimum latency.
        public let minLatency: Int?
        /// The name of the output. This value must be unique within the current flow.
        public let name: String?
        /// The port to use when content is distributed to this output.
        public let port: Int?
        /// The protocol to use for the output.
        public let `protocol`: `Protocol`
        /// The remote ID for the Zixi-pull output stream.
        public let remoteId: String?
        /// The port that the flow uses to send outbound requests to initiate connection with the sender.
        public let senderControlPort: Int?
        /// The smoothing latency in milliseconds for RIST, RTP, and RTP-FEC streams.
        public let smoothingLatency: Int?
        /// The stream ID that you want to use for this transport. This parameter applies only to Zixi-based streams.
        public let streamId: String?
        /// The name of the VPC interface attachment to use for this output.
        public let vpcInterfaceAttachment: VpcInterfaceAttachment?

        public init(cidrAllowList: [String]? = nil, description: String? = nil, destination: String? = nil, encryption: Encryption? = nil, maxLatency: Int? = nil, mediaStreamOutputConfigurations: [MediaStreamOutputConfigurationRequest]? = nil, minLatency: Int? = nil, name: String? = nil, port: Int? = nil, protocol: `Protocol`, remoteId: String? = nil, senderControlPort: Int? = nil, smoothingLatency: Int? = nil, streamId: String? = nil, vpcInterfaceAttachment: VpcInterfaceAttachment? = nil) {
            self.cidrAllowList = cidrAllowList
            self.description = description
            self.destination = destination
            self.encryption = encryption
            self.maxLatency = maxLatency
            self.mediaStreamOutputConfigurations = mediaStreamOutputConfigurations
            self.minLatency = minLatency
            self.name = name
            self.port = port
            self.`protocol` = `protocol`
            self.remoteId = remoteId
            self.senderControlPort = senderControlPort
            self.smoothingLatency = smoothingLatency
            self.streamId = streamId
            self.vpcInterfaceAttachment = vpcInterfaceAttachment
        }

        private enum CodingKeys: String, CodingKey {
            case cidrAllowList
            case description
            case destination
            case encryption
            case maxLatency
            case mediaStreamOutputConfigurations
            case minLatency
            case name
            case port
            case `protocol`
            case remoteId
            case senderControlPort
            case smoothingLatency
            case streamId
            case vpcInterfaceAttachment
        }
    }

    public struct CreateFlowRequest: AWSEncodableShape {
        /// The Availability Zone that you want to create the flow in. These options are limited to the Availability Zones within the current AWS Region.
        public let availabilityZone: String?
        /// The entitlements that you want to grant on a flow.
        public let entitlements: [GrantEntitlementRequest]?
        public let maintenance: AddMaintenance?
        /// The media streams that you want to add to the flow. You can associate these media streams with sources and outputs on the flow.
        public let mediaStreams: [AddMediaStreamRequest]?
        /// The name of the flow.
        public let name: String
        /// The outputs that you want to add to this flow.
        public let outputs: [AddOutputRequest]?
        public let source: SetSourceRequest?
        public let sourceFailoverConfig: FailoverConfig?
        public let sources: [SetSourceRequest]?
        /// The VPC interfaces you want on the flow.
        public let vpcInterfaces: [VpcInterfaceRequest]?

        public init(availabilityZone: String? = nil, entitlements: [GrantEntitlementRequest]? = nil, maintenance: AddMaintenance? = nil, mediaStreams: [AddMediaStreamRequest]? = nil, name: String, outputs: [AddOutputRequest]? = nil, source: SetSourceRequest? = nil, sourceFailoverConfig: FailoverConfig? = nil, sources: [SetSourceRequest]? = nil, vpcInterfaces: [VpcInterfaceRequest]? = nil) {
            self.availabilityZone = availabilityZone
            self.entitlements = entitlements
            self.maintenance = maintenance
            self.mediaStreams = mediaStreams
            self.name = name
            self.outputs = outputs
            self.source = source
            self.sourceFailoverConfig = sourceFailoverConfig
            self.sources = sources
            self.vpcInterfaces = vpcInterfaces
        }

        private enum CodingKeys: String, CodingKey {
            case availabilityZone
            case entitlements
            case maintenance
            case mediaStreams
            case name
            case outputs
            case source
            case sourceFailoverConfig
            case sources
            case vpcInterfaces
        }
    }

    public struct CreateFlowResponse: AWSDecodableShape {
        public let flow: Flow?

        public init(flow: Flow? = nil) {
            self.flow = flow
        }

        private enum CodingKeys: String, CodingKey {
            case flow
        }
    }

    public struct DeleteFlowRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn"))
        ]

        /// The ARN of the flow that you want to delete.
        public let flowArn: String

        public init(flowArn: String) {
            self.flowArn = flowArn
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteFlowResponse: AWSDecodableShape {
        /// The ARN of the flow that was deleted.
        public let flowArn: String?
        /// The status of the flow when the DeleteFlow process begins.
        public let status: Status?

        public init(flowArn: String? = nil, status: Status? = nil) {
            self.flowArn = flowArn
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case flowArn
            case status
        }
    }

    public struct DescribeFlowRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn"))
        ]

        /// The ARN of the flow that you want to describe.
        public let flowArn: String

        public init(flowArn: String) {
            self.flowArn = flowArn
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DescribeFlowResponse: AWSDecodableShape {
        public let flow: Flow?
        public let messages: Messages?

        public init(flow: Flow? = nil, messages: Messages? = nil) {
            self.flow = flow
            self.messages = messages
        }

        private enum CodingKeys: String, CodingKey {
            case flow
            case messages
        }
    }

    public struct DescribeOfferingRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "offeringArn", location: .uri("OfferingArn"))
        ]

        /// The Amazon Resource Name (ARN) of the offering.
        public let offeringArn: String

        public init(offeringArn: String) {
            self.offeringArn = offeringArn
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DescribeOfferingResponse: AWSDecodableShape {
        public let offering: Offering?

        public init(offering: Offering? = nil) {
            self.offering = offering
        }

        private enum CodingKeys: String, CodingKey {
            case offering
        }
    }

    public struct DescribeReservationRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "reservationArn", location: .uri("ReservationArn"))
        ]

        /// The Amazon Resource Name (ARN) of the reservation.
        public let reservationArn: String

        public init(reservationArn: String) {
            self.reservationArn = reservationArn
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DescribeReservationResponse: AWSDecodableShape {
        public let reservation: Reservation?

        public init(reservation: Reservation? = nil) {
            self.reservation = reservation
        }

        private enum CodingKeys: String, CodingKey {
            case reservation
        }
    }

    public struct DestinationConfiguration: AWSDecodableShape {
        /// The IP address where contents of the media stream will be sent.
        public let destinationIp: String
        /// The port to use when the content of the media stream is distributed to the output.
        public let destinationPort: Int
        /// The VPC interface that is used for the media stream associated with the output.
        public let interface: Interface
        /// The IP address that the receiver requires in order to establish a connection with the flow. This value is represented by the elastic network interface IP address of the VPC. This field applies only to outputs that use the CDI or ST 2110 JPEG XS protocol.
        public let outboundIp: String

        public init(destinationIp: String, destinationPort: Int, interface: Interface, outboundIp: String) {
            self.destinationIp = destinationIp
            self.destinationPort = destinationPort
            self.interface = interface
            self.outboundIp = outboundIp
        }

        private enum CodingKeys: String, CodingKey {
            case destinationIp
            case destinationPort
            case interface
            case outboundIp
        }
    }

    public struct DestinationConfigurationRequest: AWSEncodableShape {
        /// The IP address where you want MediaConnect to send contents of the media stream.
        public let destinationIp: String
        /// The port that you want MediaConnect to use when it distributes the media stream to the output.
        public let destinationPort: Int
        /// The VPC interface that you want to use for the media stream associated with the output.
        public let interface: InterfaceRequest

        public init(destinationIp: String, destinationPort: Int = 0, interface: InterfaceRequest) {
            self.destinationIp = destinationIp
            self.destinationPort = destinationPort
            self.interface = interface
        }

        private enum CodingKeys: String, CodingKey {
            case destinationIp
            case destinationPort
            case interface
        }
    }

    public struct EncodingParameters: AWSDecodableShape {
        /// A value that is used to calculate compression for an output. The bitrate of the output is calculated as follows: Output bitrate = (1 / compressionFactor) * (source bitrate) This property only applies to outputs that use the ST 2110 JPEG XS protocol, with a flow source that uses the CDI protocol. Valid values are floating point numbers in the range of 3.0 to 10.0, inclusive.
        public let compressionFactor: Double
        /// A setting on the encoder that drives compression settings. This property only applies to video media streams associated with outputs that use the ST 2110 JPEG XS protocol, with a flow source that uses the CDI protocol.
        public let encoderProfile: EncoderProfile

        public init(compressionFactor: Double, encoderProfile: EncoderProfile) {
            self.compressionFactor = compressionFactor
            self.encoderProfile = encoderProfile
        }

        private enum CodingKeys: String, CodingKey {
            case compressionFactor
            case encoderProfile
        }
    }

    public struct EncodingParametersRequest: AWSEncodableShape {
        /// A value that is used to calculate compression for an output. The bitrate of the output is calculated as follows: Output bitrate = (1 / compressionFactor) * (source bitrate) This property only applies to outputs that use the ST 2110 JPEG XS protocol, with a flow source that uses the CDI protocol. Valid values are floating point numbers in the range of 3.0 to 10.0, inclusive.
        public let compressionFactor: Double
        /// A setting on the encoder that drives compression settings. This property only applies to video media streams associated with outputs that use the ST 2110 JPEG XS protocol, if at least one source on the flow uses the CDI protocol.
        public let encoderProfile: EncoderProfile

        public init(compressionFactor: Double = 0, encoderProfile: EncoderProfile) {
            self.compressionFactor = compressionFactor
            self.encoderProfile = encoderProfile
        }

        private enum CodingKeys: String, CodingKey {
            case compressionFactor
            case encoderProfile
        }
    }

    public struct Encryption: AWSEncodableShape & AWSDecodableShape {
        /// The type of algorithm that is used for the encryption (such as aes128, aes192, or aes256).
        public let algorithm: Algorithm?
        /// A 128-bit, 16-byte hex value represented by a 32-character string, to be used with the key for encrypting content. This parameter is not valid for static key encryption.
        public let constantInitializationVector: String?
        /// The value of one of the devices that you configured with your digital rights management (DRM) platform key provider. This parameter is required for SPEKE encryption and is not valid for static key encryption.
        public let deviceId: String?
        /// The type of key that is used for the encryption. If no keyType is provided, the service will use the default setting (static-key).
        public let keyType: KeyType?
        /// The AWS Region that the API Gateway proxy endpoint was created in. This parameter is required for SPEKE encryption and is not valid for static key encryption.
        public let region: String?
        /// An identifier for the content. The service sends this value to the key server to identify the current endpoint. The resource ID is also known as the content ID. This parameter is required for SPEKE encryption and is not valid for static key encryption.
        public let resourceId: String?
        /// The ARN of the role that you created during setup (when you set up AWS Elemental MediaConnect as a trusted entity).
        public let roleArn: String
        /// The ARN of the secret that you created in AWS Secrets Manager to store the encryption key. This parameter is required for static key encryption and is not valid for SPEKE encryption.
        public let secretArn: String?
        /// The URL from the API Gateway proxy that you set up to talk to your key server. This parameter is required for SPEKE encryption and is not valid for static key encryption.
        public let url: String?

        public init(algorithm: Algorithm? = nil, constantInitializationVector: String? = nil, deviceId: String? = nil, keyType: KeyType? = nil, region: String? = nil, resourceId: String? = nil, roleArn: String, secretArn: String? = nil, url: String? = nil) {
            self.algorithm = algorithm
            self.constantInitializationVector = constantInitializationVector
            self.deviceId = deviceId
            self.keyType = keyType
            self.region = region
            self.resourceId = resourceId
            self.roleArn = roleArn
            self.secretArn = secretArn
            self.url = url
        }

        private enum CodingKeys: String, CodingKey {
            case algorithm
            case constantInitializationVector
            case deviceId
            case keyType
            case region
            case resourceId
            case roleArn
            case secretArn
            case url
        }
    }

    public struct Entitlement: AWSDecodableShape {
        /// Percentage from 0-100 of the data transfer cost to be billed to the subscriber.
        public let dataTransferSubscriberFeePercent: Int?
        /// A description of the entitlement.
        public let description: String?
        /// The type of encryption that will be used on the output that is associated with this entitlement.
        public let encryption: Encryption?
        /// The ARN of the entitlement.
        public let entitlementArn: String
        /// An indication of whether the entitlement is enabled.
        public let entitlementStatus: EntitlementStatus?
        /// The name of the entitlement.
        public let name: String
        /// The AWS account IDs that you want to share your content with. The receiving accounts (subscribers) will be allowed to create their own flow using your content as the source.
        public let subscribers: [String]

        public init(dataTransferSubscriberFeePercent: Int? = nil, description: String? = nil, encryption: Encryption? = nil, entitlementArn: String, entitlementStatus: EntitlementStatus? = nil, name: String, subscribers: [String]) {
            self.dataTransferSubscriberFeePercent = dataTransferSubscriberFeePercent
            self.description = description
            self.encryption = encryption
            self.entitlementArn = entitlementArn
            self.entitlementStatus = entitlementStatus
            self.name = name
            self.subscribers = subscribers
        }

        private enum CodingKeys: String, CodingKey {
            case dataTransferSubscriberFeePercent
            case description
            case encryption
            case entitlementArn
            case entitlementStatus
            case name
            case subscribers
        }
    }

    public struct FailoverConfig: AWSEncodableShape & AWSDecodableShape {
        /// The type of failover you choose for this flow. MERGE combines the source streams into a single stream, allowing graceful recovery from any single-source loss. FAILOVER allows switching between different streams.
        public let failoverMode: FailoverMode?
        /// Search window time to look for dash-7 packets
        public let recoveryWindow: Int?
        /// The priority you want to assign to a source. You can have a primary stream and a backup stream or two equally prioritized streams.
        public let sourcePriority: SourcePriority?
        public let state: State?

        public init(failoverMode: FailoverMode? = nil, recoveryWindow: Int? = nil, sourcePriority: SourcePriority? = nil, state: State? = nil) {
            self.failoverMode = failoverMode
            self.recoveryWindow = recoveryWindow
            self.sourcePriority = sourcePriority
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case failoverMode
            case recoveryWindow
            case sourcePriority
            case state
        }
    }

    public struct Flow: AWSDecodableShape {
        /// The Availability Zone that you want to create the flow in. These options are limited to the Availability Zones within the current AWS.
        public let availabilityZone: String
        /// A description of the flow. This value is not used or seen outside of the current AWS Elemental MediaConnect account.
        public let description: String?
        /// The IP address from which video will be sent to output destinations.
        public let egressIp: String?
        /// The entitlements in this flow.
        public let entitlements: [Entitlement]
        /// The Amazon Resource Name (ARN), a unique identifier for any AWS resource, of the flow.
        public let flowArn: String
        public let maintenance: Maintenance?
        /// The media streams that are associated with the flow. After you associate a media stream with a source, you can also associate it with outputs on the flow.
        public let mediaStreams: [MediaStream]?
        /// The name of the flow.
        public let name: String
        /// The outputs in this flow.
        public let outputs: [Output]
        public let source: Source
        public let sourceFailoverConfig: FailoverConfig?
        public let sources: [Source]?
        /// The current status of the flow.
        public let status: Status
        /// The VPC Interfaces for this flow.
        public let vpcInterfaces: [VpcInterface]?

        public init(availabilityZone: String, description: String? = nil, egressIp: String? = nil, entitlements: [Entitlement], flowArn: String, maintenance: Maintenance? = nil, mediaStreams: [MediaStream]? = nil, name: String, outputs: [Output], source: Source, sourceFailoverConfig: FailoverConfig? = nil, sources: [Source]? = nil, status: Status, vpcInterfaces: [VpcInterface]? = nil) {
            self.availabilityZone = availabilityZone
            self.description = description
            self.egressIp = egressIp
            self.entitlements = entitlements
            self.flowArn = flowArn
            self.maintenance = maintenance
            self.mediaStreams = mediaStreams
            self.name = name
            self.outputs = outputs
            self.source = source
            self.sourceFailoverConfig = sourceFailoverConfig
            self.sources = sources
            self.status = status
            self.vpcInterfaces = vpcInterfaces
        }

        private enum CodingKeys: String, CodingKey {
            case availabilityZone
            case description
            case egressIp
            case entitlements
            case flowArn
            case maintenance
            case mediaStreams
            case name
            case outputs
            case source
            case sourceFailoverConfig
            case sources
            case status
            case vpcInterfaces
        }
    }

    public struct Fmtp: AWSDecodableShape {
        /// The format of the audio channel.
        public let channelOrder: String?
        /// The format that is used for the representation of color.
        public let colorimetry: Colorimetry?
        /// The frame rate for the video stream, in frames/second. For example: 60000/1001. If you specify a whole number, MediaConnect uses a ratio of N/1. For example, if you specify 60, MediaConnect uses 60/1 as the exactFramerate.
        public let exactFramerate: String?
        /// The pixel aspect ratio (PAR) of the video.
        public let par: String?
        /// The encoding range of the video.
        public let range: Range?
        /// The type of compression that was used to smooth the video’s appearance
        public let scanMode: ScanMode?
        /// The transfer characteristic system (TCS) that is used in the video.
        public let tcs: Tcs?

        public init(channelOrder: String? = nil, colorimetry: Colorimetry? = nil, exactFramerate: String? = nil, par: String? = nil, range: Range? = nil, scanMode: ScanMode? = nil, tcs: Tcs? = nil) {
            self.channelOrder = channelOrder
            self.colorimetry = colorimetry
            self.exactFramerate = exactFramerate
            self.par = par
            self.range = range
            self.scanMode = scanMode
            self.tcs = tcs
        }

        private enum CodingKeys: String, CodingKey {
            case channelOrder
            case colorimetry
            case exactFramerate
            case par
            case range
            case scanMode
            case tcs
        }
    }

    public struct FmtpRequest: AWSEncodableShape {
        /// The format of the audio channel.
        public let channelOrder: String?
        /// The format that is used for the representation of color.
        public let colorimetry: Colorimetry?
        /// The frame rate for the video stream, in frames/second. For example: 60000/1001. If you specify a whole number, MediaConnect uses a ratio of N/1. For example, if you specify 60, MediaConnect uses 60/1 as the exactFramerate.
        public let exactFramerate: String?
        /// The pixel aspect ratio (PAR) of the video.
        public let par: String?
        /// The encoding range of the video.
        public let range: Range?
        /// The type of compression that was used to smooth the video’s appearance.
        public let scanMode: ScanMode?
        /// The transfer characteristic system (TCS) that is used in the video.
        public let tcs: Tcs?

        public init(channelOrder: String? = nil, colorimetry: Colorimetry? = nil, exactFramerate: String? = nil, par: String? = nil, range: Range? = nil, scanMode: ScanMode? = nil, tcs: Tcs? = nil) {
            self.channelOrder = channelOrder
            self.colorimetry = colorimetry
            self.exactFramerate = exactFramerate
            self.par = par
            self.range = range
            self.scanMode = scanMode
            self.tcs = tcs
        }

        private enum CodingKeys: String, CodingKey {
            case channelOrder
            case colorimetry
            case exactFramerate
            case par
            case range
            case scanMode
            case tcs
        }
    }

    public struct GrantEntitlementRequest: AWSEncodableShape {
        /// Percentage from 0-100 of the data transfer cost to be billed to the subscriber.
        public let dataTransferSubscriberFeePercent: Int?
        /// A description of the entitlement. This description appears only on the AWS Elemental MediaConnect console and will not be seen by the subscriber or end user.
        public let description: String?
        /// The type of encryption that will be used on the output that is associated with this entitlement.
        public let encryption: Encryption?
        /// An indication of whether the new entitlement should be enabled or disabled as soon as it is created. If you don’t specify the entitlementStatus field in your request, MediaConnect sets it to ENABLED.
        public let entitlementStatus: EntitlementStatus?
        /// The name of the entitlement. This value must be unique within the current flow.
        public let name: String?
        /// The AWS account IDs that you want to share your content with. The receiving accounts (subscribers) will be allowed to create their own flows using your content as the source.
        public let subscribers: [String]

        public init(dataTransferSubscriberFeePercent: Int? = nil, description: String? = nil, encryption: Encryption? = nil, entitlementStatus: EntitlementStatus? = nil, name: String? = nil, subscribers: [String]) {
            self.dataTransferSubscriberFeePercent = dataTransferSubscriberFeePercent
            self.description = description
            self.encryption = encryption
            self.entitlementStatus = entitlementStatus
            self.name = name
            self.subscribers = subscribers
        }

        private enum CodingKeys: String, CodingKey {
            case dataTransferSubscriberFeePercent
            case description
            case encryption
            case entitlementStatus
            case name
            case subscribers
        }
    }

    public struct GrantFlowEntitlementsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn"))
        ]

        /// The list of entitlements that you want to grant.
        public let entitlements: [GrantEntitlementRequest]
        /// The flow that you want to grant entitlements on.
        public let flowArn: String

        public init(entitlements: [GrantEntitlementRequest], flowArn: String) {
            self.entitlements = entitlements
            self.flowArn = flowArn
        }

        private enum CodingKeys: String, CodingKey {
            case entitlements
        }
    }

    public struct GrantFlowEntitlementsResponse: AWSDecodableShape {
        /// The entitlements that were just granted.
        public let entitlements: [Entitlement]?
        /// The ARN of the flow that these entitlements were granted to.
        public let flowArn: String?

        public init(entitlements: [Entitlement]? = nil, flowArn: String? = nil) {
            self.entitlements = entitlements
            self.flowArn = flowArn
        }

        private enum CodingKeys: String, CodingKey {
            case entitlements
            case flowArn
        }
    }

    public struct InputConfiguration: AWSDecodableShape {
        /// The IP address that the flow listens on for incoming content for a media stream.
        public let inputIp: String
        /// The port that the flow listens on for an incoming media stream.
        public let inputPort: Int
        /// The VPC interface where the media stream comes in from.
        public let interface: Interface

        public init(inputIp: String, inputPort: Int, interface: Interface) {
            self.inputIp = inputIp
            self.inputPort = inputPort
            self.interface = interface
        }

        private enum CodingKeys: String, CodingKey {
            case inputIp
            case inputPort
            case interface
        }
    }

    public struct InputConfigurationRequest: AWSEncodableShape {
        /// The port that you want the flow to listen on for an incoming media stream.
        public let inputPort: Int
        /// The VPC interface that you want to use for the incoming media stream.
        public let interface: InterfaceRequest

        public init(inputPort: Int = 0, interface: InterfaceRequest) {
            self.inputPort = inputPort
            self.interface = interface
        }

        private enum CodingKeys: String, CodingKey {
            case inputPort
            case interface
        }
    }

    public struct Interface: AWSDecodableShape {
        /// The name of the VPC interface.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case name
        }
    }

    public struct InterfaceRequest: AWSEncodableShape {
        /// The name of the VPC interface.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case name
        }
    }

    public struct ListEntitlementsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        /// The maximum number of results to return per API request. For example, you submit a ListEntitlements request with MaxResults set at 5. Although 20 items match your request, the service returns no more than the first 5 items. (The service also returns a NextToken value that you can use to fetch the next batch of results.) The service might return fewer results than the MaxResults value. If MaxResults is not included in the request, the service defaults to pagination with a maximum of 20 results per page.
        public let maxResults: Int?
        /// The token that identifies which batch of results that you want to see. For example, you submit a ListEntitlements request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a NextToken value. To see the next batch of results, you can submit the ListEntitlements request a second time and specify the NextToken value.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListEntitlementsResponse: AWSDecodableShape {
        /// A list of entitlements that have been granted to you from other AWS accounts.
        public let entitlements: [ListedEntitlement]?
        /// The token that identifies which batch of results that you want to see. For example, you submit a ListEntitlements request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a NextToken value. To see the next batch of results, you can submit the ListEntitlements request a second time and specify the NextToken value.
        public let nextToken: String?

        public init(entitlements: [ListedEntitlement]? = nil, nextToken: String? = nil) {
            self.entitlements = entitlements
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case entitlements
            case nextToken
        }
    }

    public struct ListFlowsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        /// The maximum number of results to return per API request. For example, you submit a ListFlows request with MaxResults set at 5. Although 20 items match your request, the service returns no more than the first 5 items. (The service also returns a NextToken value that you can use to fetch the next batch of results.) The service might return fewer results than the MaxResults value. If MaxResults is not included in the request, the service defaults to pagination with a maximum of 10 results per page.
        public let maxResults: Int?
        /// The token that identifies which batch of results that you want to see. For example, you submit a ListFlows request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a NextToken value. To see the next batch of results, you can submit the ListFlows request a second time and specify the NextToken value.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListFlowsResponse: AWSDecodableShape {
        /// A list of flow summaries.
        public let flows: [ListedFlow]?
        /// The token that identifies which batch of results that you want to see. For example, you submit a ListFlows request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a NextToken value. To see the next batch of results, you can submit the ListFlows request a second time and specify the NextToken value.
        public let nextToken: String?

        public init(flows: [ListedFlow]? = nil, nextToken: String? = nil) {
            self.flows = flows
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case flows
            case nextToken
        }
    }

    public struct ListOfferingsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        /// The maximum number of results to return per API request. For example, you submit a ListOfferings request with MaxResults set at 5. Although 20 items match your request, the service returns no more than the first 5 items. (The service also returns a NextToken value that you can use to fetch the next batch of results.) The service might return fewer results than the MaxResults value. If MaxResults is not included in the request, the service defaults to pagination with a maximum of 10 results per page.
        public let maxResults: Int?
        /// The token that identifies which batch of results that you want to see. For example, you submit a ListOfferings request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a NextToken value. To see the next batch of results, you can submit the ListOfferings request a second time and specify the NextToken value.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListOfferingsResponse: AWSDecodableShape {
        /// The token that identifies which batch of results that you want to see. For example, you submit a ListOfferings request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a NextToken value. To see the next batch of results, you can submit the ListOfferings request a second time and specify the NextToken value.
        public let nextToken: String?
        /// A list of offerings that are available to this account in the current AWS Region.
        public let offerings: [Offering]?

        public init(nextToken: String? = nil, offerings: [Offering]? = nil) {
            self.nextToken = nextToken
            self.offerings = offerings
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case offerings
        }
    }

    public struct ListReservationsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        /// The maximum number of results to return per API request. For example, you submit a ListReservations request with MaxResults set at 5. Although 20 items match your request, the service returns no more than the first 5 items. (The service also returns a NextToken value that you can use to fetch the next batch of results.) The service might return fewer results than the MaxResults value. If MaxResults is not included in the request, the service defaults to pagination with a maximum of 10 results per page.
        public let maxResults: Int?
        /// The token that identifies which batch of results that you want to see. For example, you submit a ListReservations request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a NextToken value. To see the next batch of results, you can submit the ListOfferings request a second time and specify the NextToken value.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListReservationsResponse: AWSDecodableShape {
        /// The token that identifies which batch of results that you want to see. For example, you submit a ListReservations request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a NextToken value. To see the next batch of results, you can submit the ListReservations request a second time and specify the NextToken value.
        public let nextToken: String?
        /// A list of all reservations that have been purchased by this account in the current AWS Region.
        public let reservations: [Reservation]?

        public init(nextToken: String? = nil, reservations: [Reservation]? = nil) {
            self.nextToken = nextToken
            self.reservations = reservations
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case reservations
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn"))
        ]

        /// The Amazon Resource Name (ARN) that identifies the AWS Elemental MediaConnect resource for which to list the tags.
        public let resourceArn: String

        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// A map from tag keys to values. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
        public let tags: [String: String]?

        public init(tags: [String: String]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags
        }
    }

    public struct ListedEntitlement: AWSDecodableShape {
        /// Percentage from 0-100 of the data transfer cost to be billed to the subscriber.
        public let dataTransferSubscriberFeePercent: Int?
        /// The ARN of the entitlement.
        public let entitlementArn: String
        /// The name of the entitlement.
        public let entitlementName: String

        public init(dataTransferSubscriberFeePercent: Int? = nil, entitlementArn: String, entitlementName: String) {
            self.dataTransferSubscriberFeePercent = dataTransferSubscriberFeePercent
            self.entitlementArn = entitlementArn
            self.entitlementName = entitlementName
        }

        private enum CodingKeys: String, CodingKey {
            case dataTransferSubscriberFeePercent
            case entitlementArn
            case entitlementName
        }
    }

    public struct ListedFlow: AWSDecodableShape {
        /// The Availability Zone that the flow was created in.
        public let availabilityZone: String
        /// A description of the flow.
        public let description: String
        /// The ARN of the flow.
        public let flowArn: String
        public let maintenance: Maintenance?
        /// The name of the flow.
        public let name: String
        /// The type of source. This value is either owned (originated somewhere other than an AWS Elemental MediaConnect flow owned by another AWS account) or entitled (originated at an AWS Elemental MediaConnect flow owned by another AWS account).
        public let sourceType: SourceType
        /// The current status of the flow.
        public let status: Status

        public init(availabilityZone: String, description: String, flowArn: String, maintenance: Maintenance? = nil, name: String, sourceType: SourceType, status: Status) {
            self.availabilityZone = availabilityZone
            self.description = description
            self.flowArn = flowArn
            self.maintenance = maintenance
            self.name = name
            self.sourceType = sourceType
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case availabilityZone
            case description
            case flowArn
            case maintenance
            case name
            case sourceType
            case status
        }
    }

    public struct Maintenance: AWSDecodableShape {
        /// A day of a week when the maintenance will happen. Use Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday.
        public let maintenanceDay: MaintenanceDay?
        /// The Maintenance has to be performed before this deadline in ISO UTC format. Example: 2021-01-30T08:30:00Z.
        public let maintenanceDeadline: String?
        /// A scheduled date in ISO UTC format when the maintenance will happen. Use YYYY-MM-DD format. Example: 2021-01-30.
        public let maintenanceScheduledDate: String?
        /// UTC time when the maintenance will happen. Use 24-hour HH:MM format. Minutes must be 00. Example: 13:00. The default value is 02:00.
        public let maintenanceStartHour: String?

        public init(maintenanceDay: MaintenanceDay? = nil, maintenanceDeadline: String? = nil, maintenanceScheduledDate: String? = nil, maintenanceStartHour: String? = nil) {
            self.maintenanceDay = maintenanceDay
            self.maintenanceDeadline = maintenanceDeadline
            self.maintenanceScheduledDate = maintenanceScheduledDate
            self.maintenanceStartHour = maintenanceStartHour
        }

        private enum CodingKeys: String, CodingKey {
            case maintenanceDay
            case maintenanceDeadline
            case maintenanceScheduledDate
            case maintenanceStartHour
        }
    }

    public struct MediaStream: AWSDecodableShape {
        /// Attributes that are related to the media stream.
        public let attributes: MediaStreamAttributes?
        /// The sample rate for the stream. This value is measured in Hz.
        public let clockRate: Int?
        /// A description that can help you quickly identify what your media stream is used for.
        public let description: String?
        /// The format type number (sometimes referred to as RTP payload type) of the media stream. MediaConnect assigns this value to the media stream. For ST 2110 JPEG XS outputs, you need to provide this value to the receiver.
        public let fmt: Int
        /// A unique identifier for the media stream.
        public let mediaStreamId: Int
        /// A name that helps you distinguish one media stream from another.
        public let mediaStreamName: String
        /// The type of media stream.
        public let mediaStreamType: MediaStreamType
        /// The resolution of the video.
        public let videoFormat: String?

        public init(attributes: MediaStreamAttributes? = nil, clockRate: Int? = nil, description: String? = nil, fmt: Int, mediaStreamId: Int, mediaStreamName: String, mediaStreamType: MediaStreamType, videoFormat: String? = nil) {
            self.attributes = attributes
            self.clockRate = clockRate
            self.description = description
            self.fmt = fmt
            self.mediaStreamId = mediaStreamId
            self.mediaStreamName = mediaStreamName
            self.mediaStreamType = mediaStreamType
            self.videoFormat = videoFormat
        }

        private enum CodingKeys: String, CodingKey {
            case attributes
            case clockRate
            case description
            case fmt
            case mediaStreamId
            case mediaStreamName
            case mediaStreamType
            case videoFormat
        }
    }

    public struct MediaStreamAttributes: AWSDecodableShape {
        /// A set of parameters that define the media stream.
        public let fmtp: Fmtp
        /// The audio language, in a format that is recognized by the receiver.
        public let lang: String?

        public init(fmtp: Fmtp, lang: String? = nil) {
            self.fmtp = fmtp
            self.lang = lang
        }

        private enum CodingKeys: String, CodingKey {
            case fmtp
            case lang
        }
    }

    public struct MediaStreamAttributesRequest: AWSEncodableShape {
        /// The settings that you want to use to define the media stream.
        public let fmtp: FmtpRequest?
        /// The audio language, in a format that is recognized by the receiver.
        public let lang: String?

        public init(fmtp: FmtpRequest? = nil, lang: String? = nil) {
            self.fmtp = fmtp
            self.lang = lang
        }

        private enum CodingKeys: String, CodingKey {
            case fmtp
            case lang
        }
    }

    public struct MediaStreamOutputConfiguration: AWSDecodableShape {
        /// The transport parameters that are associated with each outbound media stream.
        public let destinationConfigurations: [DestinationConfiguration]?
        /// The format that was used to encode the data. For ancillary data streams, set the encoding name to smpte291. For audio streams, set the encoding name to pcm. For video, 2110 streams, set the encoding name to raw. For video, JPEG XS streams, set the encoding name to jxsv.
        public let encodingName: EncodingName
        /// Encoding parameters
        public let encodingParameters: EncodingParameters?
        /// The name of the media stream.
        public let mediaStreamName: String

        public init(destinationConfigurations: [DestinationConfiguration]? = nil, encodingName: EncodingName, encodingParameters: EncodingParameters? = nil, mediaStreamName: String) {
            self.destinationConfigurations = destinationConfigurations
            self.encodingName = encodingName
            self.encodingParameters = encodingParameters
            self.mediaStreamName = mediaStreamName
        }

        private enum CodingKeys: String, CodingKey {
            case destinationConfigurations
            case encodingName
            case encodingParameters
            case mediaStreamName
        }
    }

    public struct MediaStreamOutputConfigurationRequest: AWSEncodableShape {
        /// The transport parameters that you want to associate with the media stream.
        public let destinationConfigurations: [DestinationConfigurationRequest]?
        /// The format that will be used to encode the data. For ancillary data streams, set the encoding name to smpte291. For audio streams, set the encoding name to pcm. For video, 2110 streams, set the encoding name to raw. For video, JPEG XS streams, set the encoding name to jxsv.
        public let encodingName: EncodingName
        /// A collection of parameters that determine how MediaConnect will convert the content. These fields only apply to outputs on flows that have a CDI source.
        public let encodingParameters: EncodingParametersRequest?
        /// The name of the media stream that is associated with the output.
        public let mediaStreamName: String

        public init(destinationConfigurations: [DestinationConfigurationRequest]? = nil, encodingName: EncodingName, encodingParameters: EncodingParametersRequest? = nil, mediaStreamName: String) {
            self.destinationConfigurations = destinationConfigurations
            self.encodingName = encodingName
            self.encodingParameters = encodingParameters
            self.mediaStreamName = mediaStreamName
        }

        private enum CodingKeys: String, CodingKey {
            case destinationConfigurations
            case encodingName
            case encodingParameters
            case mediaStreamName
        }
    }

    public struct MediaStreamSourceConfiguration: AWSDecodableShape {
        /// The format that was used to encode the data. For ancillary data streams, set the encoding name to smpte291. For audio streams, set the encoding name to pcm. For video, 2110 streams, set the encoding name to raw. For video, JPEG XS streams, set the encoding name to jxsv.
        public let encodingName: EncodingName
        /// The transport parameters that are associated with an incoming media stream.
        public let inputConfigurations: [InputConfiguration]?
        /// The name of the media stream.
        public let mediaStreamName: String

        public init(encodingName: EncodingName, inputConfigurations: [InputConfiguration]? = nil, mediaStreamName: String) {
            self.encodingName = encodingName
            self.inputConfigurations = inputConfigurations
            self.mediaStreamName = mediaStreamName
        }

        private enum CodingKeys: String, CodingKey {
            case encodingName
            case inputConfigurations
            case mediaStreamName
        }
    }

    public struct MediaStreamSourceConfigurationRequest: AWSEncodableShape {
        /// The format you want to use to encode the data. For ancillary data streams, set the encoding name to smpte291. For audio streams, set the encoding name to pcm. For video, 2110 streams, set the encoding name to raw. For video, JPEG XS streams, set the encoding name to jxsv.
        public let encodingName: EncodingName
        /// The transport parameters that you want to associate with the media stream.
        public let inputConfigurations: [InputConfigurationRequest]?
        /// The name of the media stream.
        public let mediaStreamName: String

        public init(encodingName: EncodingName, inputConfigurations: [InputConfigurationRequest]? = nil, mediaStreamName: String) {
            self.encodingName = encodingName
            self.inputConfigurations = inputConfigurations
            self.mediaStreamName = mediaStreamName
        }

        private enum CodingKeys: String, CodingKey {
            case encodingName
            case inputConfigurations
            case mediaStreamName
        }
    }

    public struct Messages: AWSDecodableShape {
        /// A list of errors that might have been generated from processes on this flow.
        public let errors: [String]

        public init(errors: [String]) {
            self.errors = errors
        }

        private enum CodingKeys: String, CodingKey {
            case errors
        }
    }

    public struct Offering: AWSDecodableShape {
        /// The type of currency that is used for billing. The currencyCode used for all reservations is US dollars.
        public let currencyCode: String
        /// The length of time that your reservation would be active.
        public let duration: Int
        /// The unit of measurement for the duration of the offering.
        public let durationUnits: DurationUnits
        /// The Amazon Resource Name (ARN) that MediaConnect assigns to the offering.
        public let offeringArn: String
        /// A description of the offering.
        public let offeringDescription: String
        /// The cost of a single unit. This value, in combination with priceUnits, makes up the rate.
        public let pricePerUnit: String
        /// The unit of measurement that is used for billing. This value, in combination with pricePerUnit, makes up the rate.
        public let priceUnits: PriceUnits
        /// A definition of the amount of outbound bandwidth that you would be reserving if you purchase the offering.
        public let resourceSpecification: ResourceSpecification

        public init(currencyCode: String, duration: Int, durationUnits: DurationUnits, offeringArn: String, offeringDescription: String, pricePerUnit: String, priceUnits: PriceUnits, resourceSpecification: ResourceSpecification) {
            self.currencyCode = currencyCode
            self.duration = duration
            self.durationUnits = durationUnits
            self.offeringArn = offeringArn
            self.offeringDescription = offeringDescription
            self.pricePerUnit = pricePerUnit
            self.priceUnits = priceUnits
            self.resourceSpecification = resourceSpecification
        }

        private enum CodingKeys: String, CodingKey {
            case currencyCode
            case duration
            case durationUnits
            case offeringArn
            case offeringDescription
            case pricePerUnit
            case priceUnits
            case resourceSpecification
        }
    }

    public struct Output: AWSDecodableShape {
        /// Percentage from 0-100 of the data transfer cost to be billed to the subscriber.
        public let dataTransferSubscriberFeePercent: Int?
        /// A description of the output.
        public let description: String?
        /// The address where you want to send the output.
        public let destination: String?
        /// The type of key used for the encryption. If no keyType is provided, the service will use the default setting (static-key).
        public let encryption: Encryption?
        /// The ARN of the entitlement on the originator''s flow. This value is relevant only on entitled flows.
        public let entitlementArn: String?
        /// The IP address that the receiver requires in order to establish a connection with the flow. For public networking, the ListenerAddress is represented by the elastic IP address of the flow. For private networking, the ListenerAddress is represented by the elastic network interface IP address of the VPC. This field applies only to outputs that use the Zixi pull or SRT listener protocol.
        public let listenerAddress: String?
        /// The input ARN of the AWS Elemental MediaLive channel. This parameter is relevant only for outputs that were added by creating a MediaLive input.
        public let mediaLiveInputArn: String?
        /// The configuration for each media stream that is associated with the output.
        public let mediaStreamOutputConfigurations: [MediaStreamOutputConfiguration]?
        /// The name of the output. This value must be unique within the current flow.
        public let name: String
        /// The ARN of the output.
        public let outputArn: String
        /// The port to use when content is distributed to this output.
        public let port: Int?
        /// Attributes related to the transport stream that are used in the output.
        public let transport: Transport?
        /// The name of the VPC interface attachment to use for this output.
        public let vpcInterfaceAttachment: VpcInterfaceAttachment?

        public init(dataTransferSubscriberFeePercent: Int? = nil, description: String? = nil, destination: String? = nil, encryption: Encryption? = nil, entitlementArn: String? = nil, listenerAddress: String? = nil, mediaLiveInputArn: String? = nil, mediaStreamOutputConfigurations: [MediaStreamOutputConfiguration]? = nil, name: String, outputArn: String, port: Int? = nil, transport: Transport? = nil, vpcInterfaceAttachment: VpcInterfaceAttachment? = nil) {
            self.dataTransferSubscriberFeePercent = dataTransferSubscriberFeePercent
            self.description = description
            self.destination = destination
            self.encryption = encryption
            self.entitlementArn = entitlementArn
            self.listenerAddress = listenerAddress
            self.mediaLiveInputArn = mediaLiveInputArn
            self.mediaStreamOutputConfigurations = mediaStreamOutputConfigurations
            self.name = name
            self.outputArn = outputArn
            self.port = port
            self.transport = transport
            self.vpcInterfaceAttachment = vpcInterfaceAttachment
        }

        private enum CodingKeys: String, CodingKey {
            case dataTransferSubscriberFeePercent
            case description
            case destination
            case encryption
            case entitlementArn
            case listenerAddress
            case mediaLiveInputArn
            case mediaStreamOutputConfigurations
            case name
            case outputArn
            case port
            case transport
            case vpcInterfaceAttachment
        }
    }

    public struct PurchaseOfferingRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "offeringArn", location: .uri("OfferingArn"))
        ]

        /// The Amazon Resource Name (ARN) of the offering.
        public let offeringArn: String
        /// The name that you want to use for the reservation.
        public let reservationName: String
        /// The date and time that you want the reservation to begin, in Coordinated Universal Time (UTC). You can specify any date and time between 12:00am on the first day of the current month to the current time on today's date, inclusive. Specify the start in a 24-hour notation. Use the following format: YYYY-MM-DDTHH:mm:SSZ, where T and Z are literal characters. For example, to specify 11:30pm on March 5, 2020, enter 2020-03-05T23:30:00Z.
        public let start: String

        public init(offeringArn: String, reservationName: String, start: String) {
            self.offeringArn = offeringArn
            self.reservationName = reservationName
            self.start = start
        }

        private enum CodingKeys: String, CodingKey {
            case reservationName
            case start
        }
    }

    public struct PurchaseOfferingResponse: AWSDecodableShape {
        public let reservation: Reservation?

        public init(reservation: Reservation? = nil) {
            self.reservation = reservation
        }

        private enum CodingKeys: String, CodingKey {
            case reservation
        }
    }

    public struct RemoveFlowMediaStreamRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn")),
            AWSMemberEncoding(label: "mediaStreamName", location: .uri("MediaStreamName"))
        ]

        /// The Amazon Resource Name (ARN) of the flow.
        public let flowArn: String
        /// The name of the media stream that you want to remove.
        public let mediaStreamName: String

        public init(flowArn: String, mediaStreamName: String) {
            self.flowArn = flowArn
            self.mediaStreamName = mediaStreamName
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct RemoveFlowMediaStreamResponse: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the flow.
        public let flowArn: String?
        /// The name of the media stream that was removed.
        public let mediaStreamName: String?

        public init(flowArn: String? = nil, mediaStreamName: String? = nil) {
            self.flowArn = flowArn
            self.mediaStreamName = mediaStreamName
        }

        private enum CodingKeys: String, CodingKey {
            case flowArn
            case mediaStreamName
        }
    }

    public struct RemoveFlowOutputRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn")),
            AWSMemberEncoding(label: "outputArn", location: .uri("OutputArn"))
        ]

        /// The flow that you want to remove an output from.
        public let flowArn: String
        /// The ARN of the output that you want to remove.
        public let outputArn: String

        public init(flowArn: String, outputArn: String) {
            self.flowArn = flowArn
            self.outputArn = outputArn
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct RemoveFlowOutputResponse: AWSDecodableShape {
        /// The ARN of the flow that is associated with the output you removed.
        public let flowArn: String?
        /// The ARN of the output that was removed.
        public let outputArn: String?

        public init(flowArn: String? = nil, outputArn: String? = nil) {
            self.flowArn = flowArn
            self.outputArn = outputArn
        }

        private enum CodingKeys: String, CodingKey {
            case flowArn
            case outputArn
        }
    }

    public struct RemoveFlowSourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn")),
            AWSMemberEncoding(label: "sourceArn", location: .uri("SourceArn"))
        ]

        /// The flow that you want to remove a source from.
        public let flowArn: String
        /// The ARN of the source that you want to remove.
        public let sourceArn: String

        public init(flowArn: String, sourceArn: String) {
            self.flowArn = flowArn
            self.sourceArn = sourceArn
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct RemoveFlowSourceResponse: AWSDecodableShape {
        /// The ARN of the flow that is associated with the source you removed.
        public let flowArn: String?
        /// The ARN of the source that was removed.
        public let sourceArn: String?

        public init(flowArn: String? = nil, sourceArn: String? = nil) {
            self.flowArn = flowArn
            self.sourceArn = sourceArn
        }

        private enum CodingKeys: String, CodingKey {
            case flowArn
            case sourceArn
        }
    }

    public struct RemoveFlowVpcInterfaceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn")),
            AWSMemberEncoding(label: "vpcInterfaceName", location: .uri("VpcInterfaceName"))
        ]

        /// The flow that you want to remove a VPC interface from.
        public let flowArn: String
        /// The name of the VPC interface that you want to remove.
        public let vpcInterfaceName: String

        public init(flowArn: String, vpcInterfaceName: String) {
            self.flowArn = flowArn
            self.vpcInterfaceName = vpcInterfaceName
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct RemoveFlowVpcInterfaceResponse: AWSDecodableShape {
        /// The ARN of the flow that is associated with the VPC interface you removed.
        public let flowArn: String?
        /// IDs of network interfaces associated with the removed VPC interface that Media Connect was unable to remove.
        public let nonDeletedNetworkInterfaceIds: [String]?
        /// The name of the VPC interface that was removed.
        public let vpcInterfaceName: String?

        public init(flowArn: String? = nil, nonDeletedNetworkInterfaceIds: [String]? = nil, vpcInterfaceName: String? = nil) {
            self.flowArn = flowArn
            self.nonDeletedNetworkInterfaceIds = nonDeletedNetworkInterfaceIds
            self.vpcInterfaceName = vpcInterfaceName
        }

        private enum CodingKeys: String, CodingKey {
            case flowArn
            case nonDeletedNetworkInterfaceIds
            case vpcInterfaceName
        }
    }

    public struct Reservation: AWSDecodableShape {
        /// The type of currency that is used for billing. The currencyCode used for your reservation is US dollars.
        public let currencyCode: String
        /// The length of time that this reservation is active. MediaConnect defines this value in the offering.
        public let duration: Int
        /// The unit of measurement for the duration of the reservation. MediaConnect defines this value in the offering.
        public let durationUnits: DurationUnits
        /// The day and time that this reservation expires. This value is calculated based on the start date and time that you set and the offering's duration.
        public let end: String
        /// The Amazon Resource Name (ARN) that MediaConnect assigns to the offering.
        public let offeringArn: String
        /// A description of the offering. MediaConnect defines this value in the offering.
        public let offeringDescription: String
        /// The cost of a single unit. This value, in combination with priceUnits, makes up the rate. MediaConnect defines this value in the offering.
        public let pricePerUnit: String
        /// The unit of measurement that is used for billing. This value, in combination with pricePerUnit, makes up the rate. MediaConnect defines this value in the offering.
        public let priceUnits: PriceUnits
        /// The Amazon Resource Name (ARN) that MediaConnect assigns to the reservation when you purchase an offering.
        public let reservationArn: String
        /// The name that you assigned to the reservation when you purchased the offering.
        public let reservationName: String
        /// The status of your reservation.
        public let reservationState: ReservationState
        /// A definition of the amount of outbound bandwidth that you would be reserving if you purchase the offering. MediaConnect defines the values that make up the resourceSpecification in the offering.
        public let resourceSpecification: ResourceSpecification
        /// The day and time that the reservation becomes active. You set this value when you purchase the offering.
        public let start: String

        public init(currencyCode: String, duration: Int, durationUnits: DurationUnits, end: String, offeringArn: String, offeringDescription: String, pricePerUnit: String, priceUnits: PriceUnits, reservationArn: String, reservationName: String, reservationState: ReservationState, resourceSpecification: ResourceSpecification, start: String) {
            self.currencyCode = currencyCode
            self.duration = duration
            self.durationUnits = durationUnits
            self.end = end
            self.offeringArn = offeringArn
            self.offeringDescription = offeringDescription
            self.pricePerUnit = pricePerUnit
            self.priceUnits = priceUnits
            self.reservationArn = reservationArn
            self.reservationName = reservationName
            self.reservationState = reservationState
            self.resourceSpecification = resourceSpecification
            self.start = start
        }

        private enum CodingKeys: String, CodingKey {
            case currencyCode
            case duration
            case durationUnits
            case end
            case offeringArn
            case offeringDescription
            case pricePerUnit
            case priceUnits
            case reservationArn
            case reservationName
            case reservationState
            case resourceSpecification
            case start
        }
    }

    public struct ResourceSpecification: AWSDecodableShape {
        /// The amount of outbound bandwidth that is discounted in the offering.
        public let reservedBitrate: Int?
        /// The type of resource and the unit that is being billed for.
        public let resourceType: ResourceType

        public init(reservedBitrate: Int? = nil, resourceType: ResourceType) {
            self.reservedBitrate = reservedBitrate
            self.resourceType = resourceType
        }

        private enum CodingKeys: String, CodingKey {
            case reservedBitrate
            case resourceType
        }
    }

    public struct RevokeFlowEntitlementRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "entitlementArn", location: .uri("EntitlementArn")),
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn"))
        ]

        /// The ARN of the entitlement that you want to revoke.
        public let entitlementArn: String
        /// The flow that you want to revoke an entitlement from.
        public let flowArn: String

        public init(entitlementArn: String, flowArn: String) {
            self.entitlementArn = entitlementArn
            self.flowArn = flowArn
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct RevokeFlowEntitlementResponse: AWSDecodableShape {
        /// The ARN of the entitlement that was revoked.
        public let entitlementArn: String?
        /// The ARN of the flow that the entitlement was revoked from.
        public let flowArn: String?

        public init(entitlementArn: String? = nil, flowArn: String? = nil) {
            self.entitlementArn = entitlementArn
            self.flowArn = flowArn
        }

        private enum CodingKeys: String, CodingKey {
            case entitlementArn
            case flowArn
        }
    }

    public struct SetSourceRequest: AWSEncodableShape {
        /// The type of encryption that is used on the content ingested from this source.
        public let decryption: Encryption?
        /// A description for the source. This value is not used or seen outside of the current AWS Elemental MediaConnect account.
        public let description: String?
        /// The ARN of the entitlement that allows you to subscribe to this flow. The entitlement is set by the flow originator, and the ARN is generated as part of the originator's flow.
        public let entitlementArn: String?
        /// The port that the flow will be listening on for incoming content.
        public let ingestPort: Int?
        /// The smoothing max bitrate for RIST, RTP, and RTP-FEC streams.
        public let maxBitrate: Int?
        /// The maximum latency in milliseconds. This parameter applies only to RIST-based, Zixi-based, and Fujitsu-based streams.
        public let maxLatency: Int?
        /// The size of the buffer (in milliseconds) to use to sync incoming source data.
        public let maxSyncBuffer: Int?
        /// The media streams that are associated with the source, and the parameters for those associations.
        public let mediaStreamSourceConfigurations: [MediaStreamSourceConfigurationRequest]?
        /// The minimum latency in milliseconds for SRT-based streams. In streams that use the SRT protocol, this value that you set on your MediaConnect source or output represents the minimal potential latency of that connection. The latency of the stream is set to the highest number between the sender’s minimum latency and the receiver’s minimum latency.
        public let minLatency: Int?
        /// The name of the source.
        public let name: String?
        /// The protocol that is used by the source.
        public let `protocol`: `Protocol`?
        /// The port that the flow uses to send outbound requests to initiate connection with the sender.
        public let senderControlPort: Int?
        /// The IP address that the flow communicates with to initiate connection with the sender.
        public let senderIpAddress: String?
        /// Source IP or domain name for SRT-caller protocol.
        public let sourceListenerAddress: String?
        /// Source port for SRT-caller protocol.
        public let sourceListenerPort: Int?
        /// The stream ID that you want to use for this transport. This parameter applies only to Zixi-based streams.
        public let streamId: String?
        /// The name of the VPC interface to use for this source.
        public let vpcInterfaceName: String?
        /// The range of IP addresses that should be allowed to contribute content to your source. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.
        public let whitelistCidr: String?

        public init(decryption: Encryption? = nil, description: String? = nil, entitlementArn: String? = nil, ingestPort: Int? = nil, maxBitrate: Int? = nil, maxLatency: Int? = nil, maxSyncBuffer: Int? = nil, mediaStreamSourceConfigurations: [MediaStreamSourceConfigurationRequest]? = nil, minLatency: Int? = nil, name: String? = nil, protocol: `Protocol`? = nil, senderControlPort: Int? = nil, senderIpAddress: String? = nil, sourceListenerAddress: String? = nil, sourceListenerPort: Int? = nil, streamId: String? = nil, vpcInterfaceName: String? = nil, whitelistCidr: String? = nil) {
            self.decryption = decryption
            self.description = description
            self.entitlementArn = entitlementArn
            self.ingestPort = ingestPort
            self.maxBitrate = maxBitrate
            self.maxLatency = maxLatency
            self.maxSyncBuffer = maxSyncBuffer
            self.mediaStreamSourceConfigurations = mediaStreamSourceConfigurations
            self.minLatency = minLatency
            self.name = name
            self.`protocol` = `protocol`
            self.senderControlPort = senderControlPort
            self.senderIpAddress = senderIpAddress
            self.sourceListenerAddress = sourceListenerAddress
            self.sourceListenerPort = sourceListenerPort
            self.streamId = streamId
            self.vpcInterfaceName = vpcInterfaceName
            self.whitelistCidr = whitelistCidr
        }

        private enum CodingKeys: String, CodingKey {
            case decryption
            case description
            case entitlementArn
            case ingestPort
            case maxBitrate
            case maxLatency
            case maxSyncBuffer
            case mediaStreamSourceConfigurations
            case minLatency
            case name
            case `protocol`
            case senderControlPort
            case senderIpAddress
            case sourceListenerAddress
            case sourceListenerPort
            case streamId
            case vpcInterfaceName
            case whitelistCidr
        }
    }

    public struct Source: AWSDecodableShape {
        /// Percentage from 0-100 of the data transfer cost to be billed to the subscriber.
        public let dataTransferSubscriberFeePercent: Int?
        /// The type of encryption that is used on the content ingested from this source.
        public let decryption: Encryption?
        /// A description for the source. This value is not used or seen outside of the current AWS Elemental MediaConnect account.
        public let description: String?
        /// The ARN of the entitlement that allows you to subscribe to content that comes from another AWS account. The entitlement is set by the content originator and the ARN is generated as part of the originator's flow.
        public let entitlementArn: String?
        /// The IP address that the flow will be listening on for incoming content.
        public let ingestIp: String?
        /// The port that the flow will be listening on for incoming content.
        public let ingestPort: Int?
        /// The media streams that are associated with the source, and the parameters for those associations.
        public let mediaStreamSourceConfigurations: [MediaStreamSourceConfiguration]?
        /// The name of the source.
        public let name: String
        /// The port that the flow uses to send outbound requests to initiate connection with the sender.
        public let senderControlPort: Int?
        /// The IP address that the flow communicates with to initiate connection with the sender.
        public let senderIpAddress: String?
        /// The ARN of the source.
        public let sourceArn: String
        /// Attributes related to the transport stream that are used in the source.
        public let transport: Transport?
        /// The name of the VPC interface that is used for this source.
        public let vpcInterfaceName: String?
        /// The range of IP addresses that should be allowed to contribute content to your source. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.
        public let whitelistCidr: String?

        public init(dataTransferSubscriberFeePercent: Int? = nil, decryption: Encryption? = nil, description: String? = nil, entitlementArn: String? = nil, ingestIp: String? = nil, ingestPort: Int? = nil, mediaStreamSourceConfigurations: [MediaStreamSourceConfiguration]? = nil, name: String, senderControlPort: Int? = nil, senderIpAddress: String? = nil, sourceArn: String, transport: Transport? = nil, vpcInterfaceName: String? = nil, whitelistCidr: String? = nil) {
            self.dataTransferSubscriberFeePercent = dataTransferSubscriberFeePercent
            self.decryption = decryption
            self.description = description
            self.entitlementArn = entitlementArn
            self.ingestIp = ingestIp
            self.ingestPort = ingestPort
            self.mediaStreamSourceConfigurations = mediaStreamSourceConfigurations
            self.name = name
            self.senderControlPort = senderControlPort
            self.senderIpAddress = senderIpAddress
            self.sourceArn = sourceArn
            self.transport = transport
            self.vpcInterfaceName = vpcInterfaceName
            self.whitelistCidr = whitelistCidr
        }

        private enum CodingKeys: String, CodingKey {
            case dataTransferSubscriberFeePercent
            case decryption
            case description
            case entitlementArn
            case ingestIp
            case ingestPort
            case mediaStreamSourceConfigurations
            case name
            case senderControlPort
            case senderIpAddress
            case sourceArn
            case transport
            case vpcInterfaceName
            case whitelistCidr
        }
    }

    public struct SourcePriority: AWSEncodableShape & AWSDecodableShape {
        /// The name of the source you choose as the primary source for this flow.
        public let primarySource: String?

        public init(primarySource: String? = nil) {
            self.primarySource = primarySource
        }

        private enum CodingKeys: String, CodingKey {
            case primarySource
        }
    }

    public struct StartFlowRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn"))
        ]

        /// The ARN of the flow that you want to start.
        public let flowArn: String

        public init(flowArn: String) {
            self.flowArn = flowArn
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct StartFlowResponse: AWSDecodableShape {
        /// The ARN of the flow that you started.
        public let flowArn: String?
        /// The status of the flow when the StartFlow process begins.
        public let status: Status?

        public init(flowArn: String? = nil, status: Status? = nil) {
            self.flowArn = flowArn
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case flowArn
            case status
        }
    }

    public struct StopFlowRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn"))
        ]

        /// The ARN of the flow that you want to stop.
        public let flowArn: String

        public init(flowArn: String) {
            self.flowArn = flowArn
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct StopFlowResponse: AWSDecodableShape {
        /// The ARN of the flow that you stopped.
        public let flowArn: String?
        /// The status of the flow when the StopFlow process begins.
        public let status: Status?

        public init(flowArn: String? = nil, status: Status? = nil) {
            self.flowArn = flowArn
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case flowArn
            case status
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn"))
        ]

        /// The Amazon Resource Name (ARN) that identifies the AWS Elemental MediaConnect resource to which to add tags.
        public let resourceArn: String
        /// A map from tag keys to values. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
        public let tags: [String: String]

        public init(resourceArn: String, tags: [String: String]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags
        }
    }

    public struct Transport: AWSDecodableShape {
        /// The range of IP addresses that should be allowed to initiate output requests to this flow. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.
        public let cidrAllowList: [String]?
        /// The smoothing max bitrate for RIST, RTP, and RTP-FEC streams.
        public let maxBitrate: Int?
        /// The maximum latency in milliseconds. This parameter applies only to RIST-based, Zixi-based, and Fujitsu-based streams.
        public let maxLatency: Int?
        /// The size of the buffer (in milliseconds) to use to sync incoming source data.
        public let maxSyncBuffer: Int?
        /// The minimum latency in milliseconds for SRT-based streams. In streams that use the SRT protocol, this value that you set on your MediaConnect source or output represents the minimal potential latency of that connection. The latency of the stream is set to the highest number between the sender’s minimum latency and the receiver’s minimum latency.
        public let minLatency: Int?
        /// The protocol that is used by the source or output.
        public let `protocol`: `Protocol`
        /// The remote ID for the Zixi-pull stream.
        public let remoteId: String?
        /// The port that the flow uses to send outbound requests to initiate connection with the sender.
        public let senderControlPort: Int?
        /// The IP address that the flow communicates with to initiate connection with the sender.
        public let senderIpAddress: String?
        /// The smoothing latency in milliseconds for RIST, RTP, and RTP-FEC streams.
        public let smoothingLatency: Int?
        /// Source IP or domain name for SRT-caller protocol.
        public let sourceListenerAddress: String?
        /// Source port for SRT-caller protocol.
        public let sourceListenerPort: Int?
        /// The stream ID that you want to use for this transport. This parameter applies only to Zixi-based streams.
        public let streamId: String?

        public init(cidrAllowList: [String]? = nil, maxBitrate: Int? = nil, maxLatency: Int? = nil, maxSyncBuffer: Int? = nil, minLatency: Int? = nil, protocol: `Protocol`, remoteId: String? = nil, senderControlPort: Int? = nil, senderIpAddress: String? = nil, smoothingLatency: Int? = nil, sourceListenerAddress: String? = nil, sourceListenerPort: Int? = nil, streamId: String? = nil) {
            self.cidrAllowList = cidrAllowList
            self.maxBitrate = maxBitrate
            self.maxLatency = maxLatency
            self.maxSyncBuffer = maxSyncBuffer
            self.minLatency = minLatency
            self.`protocol` = `protocol`
            self.remoteId = remoteId
            self.senderControlPort = senderControlPort
            self.senderIpAddress = senderIpAddress
            self.smoothingLatency = smoothingLatency
            self.sourceListenerAddress = sourceListenerAddress
            self.sourceListenerPort = sourceListenerPort
            self.streamId = streamId
        }

        private enum CodingKeys: String, CodingKey {
            case cidrAllowList
            case maxBitrate
            case maxLatency
            case maxSyncBuffer
            case minLatency
            case `protocol`
            case remoteId
            case senderControlPort
            case senderIpAddress
            case smoothingLatency
            case sourceListenerAddress
            case sourceListenerPort
            case streamId
        }
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn")),
            AWSMemberEncoding(label: "tagKeys", location: .querystring("tagKeys"))
        ]

        /// The Amazon Resource Name (ARN) that identifies the AWS Elemental MediaConnect resource from which to delete tags.
        public let resourceArn: String
        /// The keys of the tags to be removed.
        public let tagKeys: [String]

        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct UpdateEncryption: AWSEncodableShape {
        /// The type of algorithm that is used for the encryption (such as aes128, aes192, or aes256).
        public let algorithm: Algorithm?
        /// A 128-bit, 16-byte hex value represented by a 32-character string, to be used with the key for encrypting content. This parameter is not valid for static key encryption.
        public let constantInitializationVector: String?
        /// The value of one of the devices that you configured with your digital rights management (DRM) platform key provider. This parameter is required for SPEKE encryption and is not valid for static key encryption.
        public let deviceId: String?
        /// The type of key that is used for the encryption. If no keyType is provided, the service will use the default setting (static-key).
        public let keyType: KeyType?
        /// The AWS Region that the API Gateway proxy endpoint was created in. This parameter is required for SPEKE encryption and is not valid for static key encryption.
        public let region: String?
        /// An identifier for the content. The service sends this value to the key server to identify the current endpoint. The resource ID is also known as the content ID. This parameter is required for SPEKE encryption and is not valid for static key encryption.
        public let resourceId: String?
        /// The ARN of the role that you created during setup (when you set up AWS Elemental MediaConnect as a trusted entity).
        public let roleArn: String?
        /// The ARN of the secret that you created in AWS Secrets Manager to store the encryption key. This parameter is required for static key encryption and is not valid for SPEKE encryption.
        public let secretArn: String?
        /// The URL from the API Gateway proxy that you set up to talk to your key server. This parameter is required for SPEKE encryption and is not valid for static key encryption.
        public let url: String?

        public init(algorithm: Algorithm? = nil, constantInitializationVector: String? = nil, deviceId: String? = nil, keyType: KeyType? = nil, region: String? = nil, resourceId: String? = nil, roleArn: String? = nil, secretArn: String? = nil, url: String? = nil) {
            self.algorithm = algorithm
            self.constantInitializationVector = constantInitializationVector
            self.deviceId = deviceId
            self.keyType = keyType
            self.region = region
            self.resourceId = resourceId
            self.roleArn = roleArn
            self.secretArn = secretArn
            self.url = url
        }

        private enum CodingKeys: String, CodingKey {
            case algorithm
            case constantInitializationVector
            case deviceId
            case keyType
            case region
            case resourceId
            case roleArn
            case secretArn
            case url
        }
    }

    public struct UpdateFailoverConfig: AWSEncodableShape {
        /// The type of failover you choose for this flow. MERGE combines the source streams into a single stream, allowing graceful recovery from any single-source loss. FAILOVER allows switching between different streams.
        public let failoverMode: FailoverMode?
        /// Recovery window time to look for dash-7 packets
        public let recoveryWindow: Int?
        /// The priority you want to assign to a source. You can have a primary stream and a backup stream or two equally prioritized streams.
        public let sourcePriority: SourcePriority?
        public let state: State?

        public init(failoverMode: FailoverMode? = nil, recoveryWindow: Int? = nil, sourcePriority: SourcePriority? = nil, state: State? = nil) {
            self.failoverMode = failoverMode
            self.recoveryWindow = recoveryWindow
            self.sourcePriority = sourcePriority
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case failoverMode
            case recoveryWindow
            case sourcePriority
            case state
        }
    }

    public struct UpdateFlowEntitlementRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "entitlementArn", location: .uri("EntitlementArn")),
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn"))
        ]

        /// A description of the entitlement. This description appears only on the AWS Elemental MediaConnect console and will not be seen by the subscriber or end user.
        public let description: String?
        /// The type of encryption that will be used on the output associated with this entitlement.
        public let encryption: UpdateEncryption?
        /// The ARN of the entitlement that you want to update.
        public let entitlementArn: String
        /// An indication of whether you want to enable the entitlement to allow access, or disable it to stop streaming content to the subscriber’s flow temporarily. If you don’t specify the entitlementStatus field in your request, MediaConnect leaves the value unchanged.
        public let entitlementStatus: EntitlementStatus?
        /// The flow that is associated with the entitlement that you want to update.
        public let flowArn: String
        /// The AWS account IDs that you want to share your content with. The receiving accounts (subscribers) will be allowed to create their own flow using your content as the source.
        public let subscribers: [String]?

        public init(description: String? = nil, encryption: UpdateEncryption? = nil, entitlementArn: String, entitlementStatus: EntitlementStatus? = nil, flowArn: String, subscribers: [String]? = nil) {
            self.description = description
            self.encryption = encryption
            self.entitlementArn = entitlementArn
            self.entitlementStatus = entitlementStatus
            self.flowArn = flowArn
            self.subscribers = subscribers
        }

        private enum CodingKeys: String, CodingKey {
            case description
            case encryption
            case entitlementStatus
            case subscribers
        }
    }

    public struct UpdateFlowEntitlementResponse: AWSDecodableShape {
        /// The new configuration of the entitlement that you updated.
        public let entitlement: Entitlement?
        /// The ARN of the flow that this entitlement was granted on.
        public let flowArn: String?

        public init(entitlement: Entitlement? = nil, flowArn: String? = nil) {
            self.entitlement = entitlement
            self.flowArn = flowArn
        }

        private enum CodingKeys: String, CodingKey {
            case entitlement
            case flowArn
        }
    }

    public struct UpdateFlowMediaStreamRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn")),
            AWSMemberEncoding(label: "mediaStreamName", location: .uri("MediaStreamName"))
        ]

        /// The attributes that you want to assign to the media stream.
        public let attributes: MediaStreamAttributesRequest?
        /// The sample rate (in Hz) for the stream. If the media stream type is video or ancillary data, set this value to 90000. If the media stream type is audio, set this value to either 48000 or 96000.
        public let clockRate: Int?
        /// Description
        public let description: String?
        /// The Amazon Resource Name (ARN) of the flow.
        public let flowArn: String
        /// The name of the media stream that you want to update.
        public let mediaStreamName: String
        /// The type of media stream.
        public let mediaStreamType: MediaStreamType?
        /// The resolution of the video.
        public let videoFormat: String?

        public init(attributes: MediaStreamAttributesRequest? = nil, clockRate: Int? = nil, description: String? = nil, flowArn: String, mediaStreamName: String, mediaStreamType: MediaStreamType? = nil, videoFormat: String? = nil) {
            self.attributes = attributes
            self.clockRate = clockRate
            self.description = description
            self.flowArn = flowArn
            self.mediaStreamName = mediaStreamName
            self.mediaStreamType = mediaStreamType
            self.videoFormat = videoFormat
        }

        private enum CodingKeys: String, CodingKey {
            case attributes
            case clockRate
            case description
            case mediaStreamType
            case videoFormat
        }
    }

    public struct UpdateFlowMediaStreamResponse: AWSDecodableShape {
        /// The ARN of the flow that is associated with the media stream that you updated.
        public let flowArn: String?
        /// The media stream that you updated.
        public let mediaStream: MediaStream?

        public init(flowArn: String? = nil, mediaStream: MediaStream? = nil) {
            self.flowArn = flowArn
            self.mediaStream = mediaStream
        }

        private enum CodingKeys: String, CodingKey {
            case flowArn
            case mediaStream
        }
    }

    public struct UpdateFlowOutputRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn")),
            AWSMemberEncoding(label: "outputArn", location: .uri("OutputArn"))
        ]

        /// The range of IP addresses that should be allowed to initiate output requests to this flow. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.
        public let cidrAllowList: [String]?
        /// A description of the output. This description appears only on the AWS Elemental MediaConnect console and will not be seen by the end user.
        public let description: String?
        /// The IP address where you want to send the output.
        public let destination: String?
        /// The type of key used for the encryption. If no keyType is provided, the service will use the default setting (static-key).
        public let encryption: UpdateEncryption?
        /// The flow that is associated with the output that you want to update.
        public let flowArn: String
        /// The maximum latency in milliseconds. This parameter applies only to RIST-based, Zixi-based, and Fujitsu-based streams.
        public let maxLatency: Int?
        /// The media streams that are associated with the output, and the parameters for those associations.
        public let mediaStreamOutputConfigurations: [MediaStreamOutputConfigurationRequest]?
        /// The minimum latency in milliseconds for SRT-based streams. In streams that use the SRT protocol, this value that you set on your MediaConnect source or output represents the minimal potential latency of that connection. The latency of the stream is set to the highest number between the sender’s minimum latency and the receiver’s minimum latency.
        public let minLatency: Int?
        /// The ARN of the output that you want to update.
        public let outputArn: String
        /// The port to use when content is distributed to this output.
        public let port: Int?
        /// The protocol to use for the output.
        public let `protocol`: `Protocol`?
        /// The remote ID for the Zixi-pull stream.
        public let remoteId: String?
        /// The port that the flow uses to send outbound requests to initiate connection with the sender.
        public let senderControlPort: Int?
        /// The IP address that the flow communicates with to initiate connection with the sender.
        public let senderIpAddress: String?
        /// The smoothing latency in milliseconds for RIST, RTP, and RTP-FEC streams.
        public let smoothingLatency: Int?
        /// The stream ID that you want to use for this transport. This parameter applies only to Zixi-based streams.
        public let streamId: String?
        /// The name of the VPC interface attachment to use for this output.
        public let vpcInterfaceAttachment: VpcInterfaceAttachment?

        public init(cidrAllowList: [String]? = nil, description: String? = nil, destination: String? = nil, encryption: UpdateEncryption? = nil, flowArn: String, maxLatency: Int? = nil, mediaStreamOutputConfigurations: [MediaStreamOutputConfigurationRequest]? = nil, minLatency: Int? = nil, outputArn: String, port: Int? = nil, protocol: `Protocol`? = nil, remoteId: String? = nil, senderControlPort: Int? = nil, senderIpAddress: String? = nil, smoothingLatency: Int? = nil, streamId: String? = nil, vpcInterfaceAttachment: VpcInterfaceAttachment? = nil) {
            self.cidrAllowList = cidrAllowList
            self.description = description
            self.destination = destination
            self.encryption = encryption
            self.flowArn = flowArn
            self.maxLatency = maxLatency
            self.mediaStreamOutputConfigurations = mediaStreamOutputConfigurations
            self.minLatency = minLatency
            self.outputArn = outputArn
            self.port = port
            self.`protocol` = `protocol`
            self.remoteId = remoteId
            self.senderControlPort = senderControlPort
            self.senderIpAddress = senderIpAddress
            self.smoothingLatency = smoothingLatency
            self.streamId = streamId
            self.vpcInterfaceAttachment = vpcInterfaceAttachment
        }

        private enum CodingKeys: String, CodingKey {
            case cidrAllowList
            case description
            case destination
            case encryption
            case maxLatency
            case mediaStreamOutputConfigurations
            case minLatency
            case port
            case `protocol`
            case remoteId
            case senderControlPort
            case senderIpAddress
            case smoothingLatency
            case streamId
            case vpcInterfaceAttachment
        }
    }

    public struct UpdateFlowOutputResponse: AWSDecodableShape {
        /// The ARN of the flow that is associated with the updated output.
        public let flowArn: String?
        /// The new settings of the output that you updated.
        public let output: Output?

        public init(flowArn: String? = nil, output: Output? = nil) {
            self.flowArn = flowArn
            self.output = output
        }

        private enum CodingKeys: String, CodingKey {
            case flowArn
            case output
        }
    }

    public struct UpdateFlowRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn"))
        ]

        /// The flow that you want to update.
        public let flowArn: String
        public let maintenance: UpdateMaintenance?
        public let sourceFailoverConfig: UpdateFailoverConfig?

        public init(flowArn: String, maintenance: UpdateMaintenance? = nil, sourceFailoverConfig: UpdateFailoverConfig? = nil) {
            self.flowArn = flowArn
            self.maintenance = maintenance
            self.sourceFailoverConfig = sourceFailoverConfig
        }

        private enum CodingKeys: String, CodingKey {
            case maintenance
            case sourceFailoverConfig
        }
    }

    public struct UpdateFlowResponse: AWSDecodableShape {
        public let flow: Flow?

        public init(flow: Flow? = nil) {
            self.flow = flow
        }

        private enum CodingKeys: String, CodingKey {
            case flow
        }
    }

    public struct UpdateFlowSourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "flowArn", location: .uri("FlowArn")),
            AWSMemberEncoding(label: "sourceArn", location: .uri("SourceArn"))
        ]

        /// The type of encryption used on the content ingested from this source.
        public let decryption: UpdateEncryption?
        /// A description for the source. This value is not used or seen outside of the current AWS Elemental MediaConnect account.
        public let description: String?
        /// The ARN of the entitlement that allows you to subscribe to this flow. The entitlement is set by the flow originator, and the ARN is generated as part of the originator's flow.
        public let entitlementArn: String?
        /// The flow that is associated with the source that you want to update.
        public let flowArn: String
        /// The port that the flow will be listening on for incoming content.
        public let ingestPort: Int?
        /// The smoothing max bitrate for RIST, RTP, and RTP-FEC streams.
        public let maxBitrate: Int?
        /// The maximum latency in milliseconds. This parameter applies only to RIST-based, Zixi-based, and Fujitsu-based streams.
        public let maxLatency: Int?
        /// The size of the buffer (in milliseconds) to use to sync incoming source data.
        public let maxSyncBuffer: Int?
        /// The media streams that are associated with the source, and the parameters for those associations.
        public let mediaStreamSourceConfigurations: [MediaStreamSourceConfigurationRequest]?
        /// The minimum latency in milliseconds for SRT-based streams. In streams that use the SRT protocol, this value that you set on your MediaConnect source or output represents the minimal potential latency of that connection. The latency of the stream is set to the highest number between the sender’s minimum latency and the receiver’s minimum latency.
        public let minLatency: Int?
        /// The protocol that is used by the source.
        public let `protocol`: `Protocol`?
        /// The port that the flow uses to send outbound requests to initiate connection with the sender.
        public let senderControlPort: Int?
        /// The IP address that the flow communicates with to initiate connection with the sender.
        public let senderIpAddress: String?
        /// The ARN of the source that you want to update.
        public let sourceArn: String
        /// Source IP or domain name for SRT-caller protocol.
        public let sourceListenerAddress: String?
        /// Source port for SRT-caller protocol.
        public let sourceListenerPort: Int?
        /// The stream ID that you want to use for this transport. This parameter applies only to Zixi-based streams.
        public let streamId: String?
        /// The name of the VPC interface to use for this source.
        public let vpcInterfaceName: String?
        /// The range of IP addresses that should be allowed to contribute content to your source. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.
        public let whitelistCidr: String?

        public init(decryption: UpdateEncryption? = nil, description: String? = nil, entitlementArn: String? = nil, flowArn: String, ingestPort: Int? = nil, maxBitrate: Int? = nil, maxLatency: Int? = nil, maxSyncBuffer: Int? = nil, mediaStreamSourceConfigurations: [MediaStreamSourceConfigurationRequest]? = nil, minLatency: Int? = nil, protocol: `Protocol`? = nil, senderControlPort: Int? = nil, senderIpAddress: String? = nil, sourceArn: String, sourceListenerAddress: String? = nil, sourceListenerPort: Int? = nil, streamId: String? = nil, vpcInterfaceName: String? = nil, whitelistCidr: String? = nil) {
            self.decryption = decryption
            self.description = description
            self.entitlementArn = entitlementArn
            self.flowArn = flowArn
            self.ingestPort = ingestPort
            self.maxBitrate = maxBitrate
            self.maxLatency = maxLatency
            self.maxSyncBuffer = maxSyncBuffer
            self.mediaStreamSourceConfigurations = mediaStreamSourceConfigurations
            self.minLatency = minLatency
            self.`protocol` = `protocol`
            self.senderControlPort = senderControlPort
            self.senderIpAddress = senderIpAddress
            self.sourceArn = sourceArn
            self.sourceListenerAddress = sourceListenerAddress
            self.sourceListenerPort = sourceListenerPort
            self.streamId = streamId
            self.vpcInterfaceName = vpcInterfaceName
            self.whitelistCidr = whitelistCidr
        }

        private enum CodingKeys: String, CodingKey {
            case decryption
            case description
            case entitlementArn
            case ingestPort
            case maxBitrate
            case maxLatency
            case maxSyncBuffer
            case mediaStreamSourceConfigurations
            case minLatency
            case `protocol`
            case senderControlPort
            case senderIpAddress
            case sourceListenerAddress
            case sourceListenerPort
            case streamId
            case vpcInterfaceName
            case whitelistCidr
        }
    }

    public struct UpdateFlowSourceResponse: AWSDecodableShape {
        /// The ARN of the flow that you want to update.
        public let flowArn: String?
        /// The settings for the source of the flow.
        public let source: Source?

        public init(flowArn: String? = nil, source: Source? = nil) {
            self.flowArn = flowArn
            self.source = source
        }

        private enum CodingKeys: String, CodingKey {
            case flowArn
            case source
        }
    }

    public struct UpdateMaintenance: AWSEncodableShape {
        /// A day of a week when the maintenance will happen. use Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday.
        public let maintenanceDay: MaintenanceDay?
        /// A scheduled date in ISO UTC format when the maintenance will happen. Use YYYY-MM-DD format. Example: 2021-01-30.
        public let maintenanceScheduledDate: String?
        /// UTC time when the maintenance will happen. Use 24-hour HH:MM format. Minutes must be 00. Example: 13:00. The default value is 02:00.
        public let maintenanceStartHour: String?

        public init(maintenanceDay: MaintenanceDay? = nil, maintenanceScheduledDate: String? = nil, maintenanceStartHour: String? = nil) {
            self.maintenanceDay = maintenanceDay
            self.maintenanceScheduledDate = maintenanceScheduledDate
            self.maintenanceStartHour = maintenanceStartHour
        }

        private enum CodingKeys: String, CodingKey {
            case maintenanceDay
            case maintenanceScheduledDate
            case maintenanceStartHour
        }
    }

    public struct VpcInterface: AWSDecodableShape {
        /// Immutable and has to be a unique against other VpcInterfaces in this Flow.
        public let name: String
        /// IDs of the network interfaces created in customer's account by MediaConnect.
        public let networkInterfaceIds: [String]
        /// The type of network interface.
        public let networkInterfaceType: NetworkInterfaceType
        /// Role Arn MediaConnect can assumes to create ENIs in customer's account
        public let roleArn: String
        /// Security Group IDs to be used on ENI.
        public let securityGroupIds: [String]
        /// Subnet must be in the AZ of the Flow
        public let subnetId: String

        public init(name: String, networkInterfaceIds: [String], networkInterfaceType: NetworkInterfaceType, roleArn: String, securityGroupIds: [String], subnetId: String) {
            self.name = name
            self.networkInterfaceIds = networkInterfaceIds
            self.networkInterfaceType = networkInterfaceType
            self.roleArn = roleArn
            self.securityGroupIds = securityGroupIds
            self.subnetId = subnetId
        }

        private enum CodingKeys: String, CodingKey {
            case name
            case networkInterfaceIds
            case networkInterfaceType
            case roleArn
            case securityGroupIds
            case subnetId
        }
    }

    public struct VpcInterfaceAttachment: AWSEncodableShape & AWSDecodableShape {
        /// The name of the VPC interface to use for this output.
        public let vpcInterfaceName: String?

        public init(vpcInterfaceName: String? = nil) {
            self.vpcInterfaceName = vpcInterfaceName
        }

        private enum CodingKeys: String, CodingKey {
            case vpcInterfaceName
        }
    }

    public struct VpcInterfaceRequest: AWSEncodableShape {
        /// The name of the VPC Interface. This value must be unique within the current flow.
        public let name: String
        /// The type of network interface. If this value is not included in the request, MediaConnect uses ENA as the networkInterfaceType.
        public let networkInterfaceType: NetworkInterfaceType?
        /// Role Arn MediaConnect can assumes to create ENIs in customer's account
        public let roleArn: String
        /// Security Group IDs to be used on ENI.
        public let securityGroupIds: [String]
        /// Subnet must be in the AZ of the Flow
        public let subnetId: String

        public init(name: String, networkInterfaceType: NetworkInterfaceType? = nil, roleArn: String, securityGroupIds: [String], subnetId: String) {
            self.name = name
            self.networkInterfaceType = networkInterfaceType
            self.roleArn = roleArn
            self.securityGroupIds = securityGroupIds
            self.subnetId = subnetId
        }

        private enum CodingKeys: String, CodingKey {
            case name
            case networkInterfaceType
            case roleArn
            case securityGroupIds
            case subnetId
        }
    }
}

// MARK: - Errors

/// Error enum for MediaConnect
public struct MediaConnectErrorType: AWSErrorType {
    enum Code: String {
        case addFlowOutputs420Exception = "AddFlowOutputs420Exception"
        case badRequestException = "BadRequestException"
        case createFlow420Exception = "CreateFlow420Exception"
        case forbiddenException = "ForbiddenException"
        case grantFlowEntitlements420Exception = "GrantFlowEntitlements420Exception"
        case internalServerErrorException = "InternalServerErrorException"
        case notFoundException = "NotFoundException"
        case serviceUnavailableException = "ServiceUnavailableException"
        case tooManyRequestsException = "TooManyRequestsException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize MediaConnect
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// Exception raised by AWS Elemental MediaConnect. See the error message and documentation for the operation for more information on the cause of this exception.
    public static var addFlowOutputs420Exception: Self { .init(.addFlowOutputs420Exception) }
    /// Exception raised by AWS Elemental MediaConnect. See the error message and documentation for the operation for more information on the cause of this exception.
    public static var badRequestException: Self { .init(.badRequestException) }
    /// Exception raised by AWS Elemental MediaConnect. See the error message and documentation for the operation for more information on the cause of this exception.
    public static var createFlow420Exception: Self { .init(.createFlow420Exception) }
    /// Exception raised by AWS Elemental MediaConnect. See the error message and documentation for the operation for more information on the cause of this exception.
    public static var forbiddenException: Self { .init(.forbiddenException) }
    /// Exception raised by AWS Elemental MediaConnect. See the error message and documentation for the operation for more information on the cause of this exception.
    public static var grantFlowEntitlements420Exception: Self { .init(.grantFlowEntitlements420Exception) }
    /// Exception raised by AWS Elemental MediaConnect. See the error message and documentation for the operation for more information on the cause of this exception.
    public static var internalServerErrorException: Self { .init(.internalServerErrorException) }
    /// Exception raised by AWS Elemental MediaConnect. See the error message and documentation for the operation for more information on the cause of this exception.
    public static var notFoundException: Self { .init(.notFoundException) }
    /// Exception raised by AWS Elemental MediaConnect. See the error message and documentation for the operation for more information on the cause of this exception.
    public static var serviceUnavailableException: Self { .init(.serviceUnavailableException) }
    /// Exception raised by AWS Elemental MediaConnect. See the error message and documentation for the operation for more information on the cause of this exception.
    public static var tooManyRequestsException: Self { .init(.tooManyRequestsException) }
}

extension MediaConnectErrorType: Equatable {
    public static func == (lhs: MediaConnectErrorType, rhs: MediaConnectErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension MediaConnectErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
